'''
Author: didiplus
Date: 2024-09-24 16:37:06
LastEditTime: 2024-09-30 15:12:58
LastEditors: didiplus
Description: 
FilePath: \pythonscript\python\趣学Python算法100例\12、出售金鱼\demo.py
'''
def calculate_fish():
    # 从最后一步推回去
    remaining = 11  # 第五次出售后的剩余金鱼数量

    # 第四次出售
    fourth_before = (remaining + 1 / 5) * 5 / 4

    # 第三次出售
    third_before = (fourth_before + 1 / 4) * 4 / 3

    # 第二次出售
    second_before = (third_before + 1 / 3) * 3 / 2

    # 第一次出售
    first_before = (second_before + 1 / 2) * 2

    return int(first_before)

# 计算原来金鱼的数量
original_fish_count = calculate_fish()
print("原来鱼缸中共有多少条金鱼：", original_fish_count)



